package com.exchangeek.server.service.mysql;

import com.exchangeek.server.adapter.MysqlConnector;
import com.exchangeek.server.adapter.SqlConnector;
import com.exchangeek.server.entity.config.SqlConnectionConfig;

import java.sql.Statement;

/**
 * Created with IntelliJ IDEA.
 * Project Name: Exchangeek_Server
 * Date Created: 2013/09/14 下午4:52
 *
 * @author Wings
 */
public abstract class DatabaseService {
    protected Statement databaseStatement;
    private SqlConnector connector;

    public DatabaseService(String databaseName) {
        init(databaseName);
    }

    private void init(String databaseName) {
        this.connector = new MysqlConnector(SqlConnectionConfig.getDefault(databaseName));
        this.databaseStatement = this.connector.connect();
    }


}
